﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AgriSmart.ErrorCode
{
    /// <summary>
    /// API分页结果模型
    /// </summary>
    /// <remarks>
    /// 用于封装分页查询的结果，包含数据列表和分页信息
    /// </remarks>
    /// <typeparam name="T">分页数据的类型</typeparam>
    public class ApiPaging<T> where T : class
    {
        /// <summary>
        /// 数据列表
        /// </summary>
        public List<T> Data { get; set; } = new List<T>();

        /// <summary>
        /// 总记录数
        /// </summary>
        /// <example>100</example>
        public int TotalCount { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        /// <example>1</example>
        public int PageIndex { get; set; }

        /// <summary>
        /// 页大小
        /// </summary>
        /// <example>10</example>
        public int PageSize { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        /// <example>10</example>
        public int TotalPages { get; set; }
    }
}
